#ifndef CUNIT_H

#define CUNIT_H

#include "Typedef.h"
#include "Struct.h"

class CBuilding;

class CUnit
{
public :
					CUnit(void);
	virtual			~CUnit(void);
	virtual	int		GetX(void)			= 0;
	virtual	int		GetGold(void)		= 0;
	virtual void	Put(void);
			int		GetState(void);
			bool	Act(void);
			bool	Hit(int _nDamage);
			bool	TargetDieCheck(CUnit const * const _pEnumy);
protected :
			bool	TargetCheck(void);

	int		m_nDelayMove;
	int		m_nDelayAttack;
	int		m_nAttackCount;
	int		m_nMoveSpeed;
	int		m_nFinalTime_Attack;
	int		m_nFinalTime_Move;
	int		m_nState;
	int		m_nX;
	int		m_nY;
	int		m_nHP;
	int		m_nDEF;
	int		m_nDamage;
	int		m_nSearchRange;
	int		m_nNowTime;
	int		m_nTagMove;
	int		m_nTagAttack;
	CUnit*	m_pTarget;
	CBuilding* m_pEnumyBuilding;
	ls_Unit	*m_pEnumys;
private :
	virtual	void	Move(void)			= 0;
	virtual	void	SearchEnumy(void)	= 0;
	virtual	bool	SearchBuilding(void)= 0;
	virtual	void	Attack(void)		= 0;
			void	BuildingAttack(void);
};

class CWarrior : public CUnit
{
public :
					CWarrior(void);
					CWarrior(int _nUnitNumber, ls_Unit* _pEnumys, SUnitAbility const &_Ability, CBuilding* _pEnumyBuildng);
					~CWarrior(void);
			int		GetX(void);
			int		GetGold(void);

private :
			void	Move(void);
			void	SearchEnumy(void);
			bool	SearchBuilding(void);
			void	Attack(void);
};

class CZombie : public CUnit
{
public :
					CZombie(void);
					CZombie(int _nUnitNumber, ls_Unit *_Enumys, SUnitAbility const &_Ability, CBuilding* _pEnumyBuildng);
					~CZombie(void);
			int		GetX(void);
			int		GetGold(void);

private :
			void	Move(void);
			void	SearchEnumy(void);
			bool	SearchBuilding(void);
			void	Attack(void);
};

#endif